import service from './index';

// 注册
export async function register(username, password) {
  try {
    const response = await service({
      method: 'POST',
      url: '/users/register',
      headers: {
        'Content-Type': 'application/json'
      },
      data: {
        username,
        password
      }
    });
    return response.data;
  } catch (error) {
    console.error('注册失败:', error);
    throw error;
  }
}
